<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="comm.dhee.dto.M002"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>華信商会(株) 販売管理業務システム</title>
<meta name="renderer" content="webkit">

<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet"
	href="css/datetimepicker/bootstrap-datetimepicker.min.css"
	media="screen" />
</head>

<body>
<form action="" method="post" id="pr105" name="pr105">
<%@include file="common/include.jsp"%>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-default">
					<div class="panel-heading">				
						<div class="row">
							<div class="col-md-6" align="left">
								<font style="font-size: 14px; line-height: 29px;">在庫情報確認</font>
							</div>		
							<div class="col-md-6" align="right">
								<button type="button" class="btn btn-primary btn-sm"
									data-toggle="modal" data-target="#goodsModal"  id="queren" name="queren">確認</button>
								<button type="reset" class="btn btn-default btn-sm" id="clean">クリア</button>
							</div>
						</div>
					</div>
					<div class="panel-body">
						<div class="col-md-4">
							<div class="input-group">
								<div class="input-group">
										<span class="input-group-addon">商品コード</span>
										<input type="text" class="form-control" id="ShouhinCode" name="ShouhinCode">
									</span>
								</div>																						
							</div>
						</div>
						<br />
						<hr />
						<%
							M002 m002 = (M002) request.getAttribute("m002");
						%>
						<table border="0">						
							<tr style="line-height: 50px;">								
									<td>在庫数：</td>
									<td style="text-decoration: underline;" id="td1">${m002.shouhinMei}</td>						
							</tr>
							<tr>
								<td>商品名：</td>
								<td style="text-decoration: underline;" id="td2">${m002.zaikoSuu}</td>
							</tr>							
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</form>

	<%@include file="common/include2.jsp"%>
	<script src="js/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript">
	
	$(function(){
		$("#queren").click(function(){
			var r = /^\d{5}$/;
			var reg = new RegExp("^[0-9]*$"); 
			if ($("#ShouhinCode").val() == "") {
			$("#ShouhinCode").focus();
			alert("商品コードを入力してください");
			}else if (!reg.test($("#ShouhinCode").val())) {
				$("#ShouhinCode").focus();
				alert("商品コード欄に半角数字を入力してください");
			}  else if (!r.test($("#ShouhinCode").val())) {
				$("#ShouhinCode").focus();
				alert("商品コード欄に5桁を入力してください");
			}else {
				document.pr105.action="toPR10501.action";	
				document.pr105.submit();
			} 
		});
	});			
	$(function() { //ready	
		$("#clean").click(function() {
			$("#td1").empty();
			$("#td2").empty();		
		}); //事件处理
	});
${message}
</script>
</body>
</html>
